<template lang="pug">
  div
    s-table(
      ref="table"
      v-if="$route.name === 'sceneMonitor_hospitalizedScene'"
      :column="tableObj.column"
      :filterProps="{items: filterItems}"
      :queryFn="tableObj.getList"
      rowKey="medinsId"
      title="住院场景列表"
      )
      template(slot="action" slot-scope="text, scope")
        el-link(type="primary" :underline="false" @click="$router.push({path: '/sceneMonitor/hospitalizedScene/dept', query: { id: scope.medinsId, title: scope.medinsName}})") 科室详情
    router-view(v-else)
</template>
<script>
import { STable } from '@/components'
import { hospitalList } from '@/api/sceneMonitor'

const column = [
  {
    prop: 'medinsCode',
    label: '医院编码'
  },
  {
    prop: 'medinsName',
    label: '医院名称'
  },
  {
    prop: 'inhospitalCnt',
    label: '在院人数',
    align: 'center'
  },
  {
    prop: 'admRecogCnt',
    label: '入院拍照人数',
    align: 'center'
  },
  {
    prop: 'amdRecogRatio',
    label: '入院拍照率',
    align: 'center'
  },
  {
    prop: 'iptWarnCnt',
    label: '预警人数',
    align: 'center'
  },
  {
    prop: 'action',
    label: '操作',
    width: '164',
    align: 'center'
  }
]

export default {
  name: 'RemoteAddList',
  components: {
    STable
  },
  data () {
    return {
      tableObj: {
        column,
        getList: hospitalList
      }
    }
  },
  computed: {
    filterItems () {
      return [
        {
          key: 'keyword',
          label: '关键信息'
        }
      ]
    }
  },
  created () {
  },
  methods: {
    // 刷新表格
    refreshTable (flag = false) {
      this.$refs.table.refresh(flag)
    }
  }
}
</script>
